<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../static/personal_center/font_2369197_oqktwkt71s/iconfont.css" media="screen">
    <script type="text/javascript" src="../../static/public_file/other/jquery.js"></script>
    <link rel="stylesheet" href="../../static/public_file/css/PersonnelChooser.css">
    <script src="../../static/administrative/layDate-v5.0.9/laydate/laydate.js"></script> <!-- 改成你的路径 -->
    <style>
        body, html {
            width: 99%;
            height: 99%;
        }

        .question_list {
            width: 100%;min-height: 70px;padding-top: 10px;padding-left: 1%;padding-right: 1%;box-sizing: border-box;border: 1px solid transparent;padding-bottom: 30px;
        }

        .question_list:hover {
            border: #0d8ddb solid 1px;
        }

        .options-span {
            float: right;color: #cecece;cursor: pointer;
        }

        .options-span:hover {
            color: #0d8ddb;
        }

        #loading {
            background: #fff url(../../static/public_file/images/jiazai.gif) no-repeat scroll center center;
            height: 100%; width: 100%; background-size: 10%; position: fixed; margin-top: 0px; top: 0px; left: 0px; bottom: 0px;
            overflow: hidden !important; right: 0px; z-index: 999999;background-color: rgba(255, 255, 255, 0.08);
        }
    </style>
</head>
<body>
    <div id="loading">
        <div id="loading-center">
        </div>
    </div>
    <div id="staff-select" class="shade">
        <div id="staff-model" style="width: 100%;height: 100%;position: absolute;">
            <div style="width: 900px;height: 500px;background: #F5F5F5;z-index: 10000;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
                <div id="staff-box" style="width: 100%;height: 40px;background: #f4f7fa;cursor: move;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 40px;font-size: 14px;">
                        选择人员
                    </div>
                    <span onclick="close_model()" style="float: right;padding-right: 2%;cursor: pointer;line-height: 37px;">
                        <i class="iconfont icon-quchu"></i>
                    </span>
                </div>
                <div style="height: 460px;width: 100%;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 70px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div id="dep" class="navigation navigation_color" onclick="change_navigation(this)">部门</div>
                        <div id="limits" class="navigation" onclick="change_navigation(this)">权限</div>
                        <div id="fun" class="navigation" onclick="change_navigation(this)">职能</div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input id="SearchDep" onkeydown="SearchDepartment()" class="search_input" type="text" placeholder="搜索" autocomplete="off">
                        </div>
                        <div id="SecondaryNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input type="checkbox" id="select-all" onclick="SelectAll(this)">
                            <input id="SearchPeo" onkeydown="SearchProple()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 65%;">
                        </div>
                        <div id="ThreeNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 410px;height: 100%;display: inline-block;vertical-align: top;overflow: auto">
                        <div style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选 <span id="selected-number">0</span> 人
                        </div>
                        <div id="selected-div" style="width: 100%;font-size: 14px;height: 370px;overflow: auto;line-height: 20px;">

                        </div>
                        <div style="width: 100%;font-size: 14px;height: 40px;text-align: center;">
                            <button id="finish_with" onclick="IdentifyPersonnel()" style="width: 100px;height: 30px;line-height: 25px;text-align: center;letter-spacing: 5px;border-radius: 3px;border: #cfcfcf solid 1px;font-size: 14px;cursor: pointer;margin-top: 10px;">完成</button>
                            <button onclick="close_model()" style="margin-left: 15px;width: 100px;height: 30px;line-height: 25px;text-align: center;color: #0abb78;letter-spacing: 5px;border-radius: 3px;font-size: 14px;border: #cfcfcf solid 1px;cursor: pointer;margin-top: 10px;">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div style="width: 100%;height: 100%;background: white;font-size: 0;">
        <div style="width: 100%;height: 40px;border-bottom: #cfcfcf solid 1px;font-size: 14px;">
            <div style="width: 150px;height: 40px;text-align: center;float: right;">
                <button onclick="submit_flow()" style="width: 100px;height: 30px;line-height: 30px;text-align: center;letter-spacing: 3px;border-radius: 3px;border: #0d8ddb solid 1px;background: #0d8ddb;color: white;margin-top: 3px;">提交</button>
            </div>
        </div>

        <div style="width: 50%;height: 94%;display: inline-block;vertical-align: top;font-size: 14px;">
            <div style="width: 100%;min-height: 80px;margin-top: 2%;padding-left: 1%;padding-right: 1%;">
                <div style="width: 100%;height: 40px;line-height: 40px;">
                    <label for="">调研标题：</label>
                    <input type="text" id="survey_title" style="width: 84%;height: 30px;border: #cfcfcf solid 1px;outline: none;" autocomplete="off">
                </div>
                <div style="width: 100%;height: 40px;line-height: 40px;margin-top: 2%;">
                    <label for="" style="letter-spacing: 1.3px;">发&nbsp;起&nbsp;人：</label>
                    <input type="text" id="apply_user" onclick="model_line_with_parameters('apply_user')" style="width: 84%;height: 30px;border: #cfcfcf solid 1px;outline: none;" autocomplete="off">
                </div>
                <div style="width: 100%;height: 40px;line-height: 40px;margin-top: 2%;">
                    <label for="">开始时间：</label>
                    <input type="text" id="start-time" style="width: 84%;height: 30px;border: #cfcfcf solid 1px;outline: none;" autocomplete="off">
                </div>
                <div style="width: 100%;height: 40px;line-height: 40px;margin-top: 2%;">
                    <label for="">结束时间：</label>
                    <input type="text" id="end-time" style="width: 84%;height: 30px;border: #cfcfcf solid 1px;outline: none;" autocomplete="off">
                </div>
                <div style="width: 100%;height: 60px;line-height: 60px;margin-top: 2%;">
                    <label for="" style="vertical-align: top;">调研说明：</label>
                    <textarea name="" id="illustrate" style="width: 84%;height: 60px;border: #cfcfcf solid 1px;outline: none;"></textarea>
                </div>
                <div style="width: 100%;margin-top: 2%;">
                    <label for="">被调研人：</label>
                    <div style="width: 84.5%;height: 150px;border: #cfcfcf solid 1px;display: inline-block;vertical-align: top;font-size: 0;">
                        <div id="identify-div" style="width: 95%;height: 100%;border-right: #cfcfcf solid 1px;overflow: auto;display: inline-block;vertical-align: top;font-size: 14px;"></div>
                        <div style="width: 4.5%;height: 100%;cursor: pointer;display: inline-block;text-align: center;vertical-align: top;line-height: 150px;" onclick="model_line_with_parameters('identify-div')">
                            <img src="../../static/back_management/images/人员管理.png" style="width: 25px;height: 25px;" alt="">
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div style="width: 50%;height: 95%;display: inline-block;vertical-align: top;font-size: 14px;">
            <div id="survey_questionnaire" style="width: 100%;height: 93%;overflow: auto;"></div>

            <div style="width: 100%;text-align: center;height: 50px;">
                <select name="" id="question_type" style="width: 47%;height: 30px;border: #cfcfcf solid 1px;display: inline-block;vertical-align: top;outline: none;margin-top: 10px;">
                    <option value="0">请选择问题类型</option>
                    <option value="1">单选</option>
                    <option value="2">多选</option>
                    <option value="3">文字</option>
                </select>

                <button onclick="add_question()" style="width: 47%;height: 29px;border: #0d8ddb solid 1px;background: #0d8ddb;color: white;line-height: 27px;letter-spacing: 4px;margin-top: 10px;margin-left: 10px;vertical-align: top;cursor: pointer;">
                    添加调研类目
                </button>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="../../static/public_file/js/PersonnelChoosersNew.js" charset="gb2312"></script>
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
        }

        lay('#version').html('-v' + laydate.v);

        laydate.render({
            elem: '#start-time', //指定元素
            type: 'date',
            format: 'yyyy-MM-dd'
        });

        laydate.render({
            elem: '#end-time', //指定元素
            type: 'date',
            format: 'yyyy-MM-dd'
        });

        function add_question() {
            var question_type = document.getElementById("question_type").value;
            var question_count = document.getElementsByClassName("question_list").length + 1
            if (question_type === '0') {
                alert("请选择问题类型！");
                return false
            }else if (question_type === '1') {
                var htmls = `
                    <div onmousemove="move_tag(`+question_count+`)" onmouseout="out_tag(`+question_count+`)" class="question_list">
                        <div style="width: 100%;">
                            <div style="height: 35px;line-height: 35px;float: left;">
                                <span id="title-`+question_count+`" data-value="a">`+question_count+`、请编辑问题？</span> <span style="color: #2db7f5;">【单选】</span>
                            </div>
                            <div id="question-list-`+question_count+`" style="height: 35px;float: right;display: none;">
                                <button onclick="edit_question(`+question_count+`)" style="width: 60px;height: 25px;line-height: 23.5px;background: #2db7f5;border: #2db7f5 solid 1px;color: white;text-align: center;letter-spacing: 4px;cursor: pointer;">编辑</button>
                                <button onclick="remove_question(this)" style="width: 60px;height: 25px;line-height: 23.5px;background: #ff0000;border: #ff0000 solid 1px;color: white;text-align: center;letter-spacing: 4px;margin-left: 10px;cursor: pointer;">删除</button>
                            </div>
                        </div>

                        <div id="text-option-`+question_count+`" style="width: 100%;margin-top: 40px;"></div>

                        <div id="question-option-`+question_count+`" style="width: 100%;margin-top: 15px;display: none;">
                            <textarea name="" id="textarea-text-`+question_count+`" style="width: 100%;height: 70px;border: #cfcfcf solid 1px;outline: none" placeholder="单选题目"></textarea>
                            <div id="options-`+question_count+`" style="width: 100%;">
                                <div style="width: 100%;height: 50px;line-height: 50px;">
                                    <input type="text" class="options-text-`+question_count+`" style="width: 90%;height: 30px;border: #cfcfcf solid 1px;outline: none;" placeholder="【单选】" autocomplete="off">
                                    <span onclick="remove_tag(this)" class="options-span">删除</span>
                                </div>
                            </div>
                        </div>

                        <div id="add-option-`+question_count+`" style="width: 100%;height: 50px;line-height: 50px;display: none;">
                            <img src="../../static/public_file/images/添加.png" alt="" style="width: 20px;height: 20px;vertical-align: middle;display: inline-block;"> <p onclick="add_option(`+question_count+`)" style="color: blue;cursor: pointer;text-align: justify;line-height: 50px;width: 200px;display: inline-block;">增加选项</p>

                            <div style="width: 100%;text-align: center;">
                                <button onclick="CancelEditing(`+question_count+`)" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #f7f7f7;border: #f7f7f7 solid 1px;cursor: pointer;">取消编辑</button>
                                <button onclick="CompleteEditing(`+question_count+`, this)" id="end-editing-`+question_count+`" data-value="单选" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #0d8ddb;color: white;border: #0d8ddb solid 1px;cursor: pointer;">完成编辑</button>
                            </div>
                        </div>
                    </div>
                `
                $("#survey_questionnaire").append(htmls);
            }else if (question_type === '2') {
                htmls = `
                    <div onmousemove="move_tag(`+question_count+`)" onmouseout="out_tag(`+question_count+`)" class="question_list">
                        <div style="width: 100%;">
                            <div style="height: 35px;line-height: 35px;float: left;">
                                <span id="title-`+question_count+`" data-value="b">`+question_count+`、请编辑问题？</span> <span style="color: #2db7f5;">【多选】</span>
                            </div>
                            <div id="question-list-`+question_count+`" style="height: 35px;float: right;display: none;">
                                <button onclick="edit_question(`+question_count+`)" style="width: 60px;height: 25px;line-height: 23.5px;background: #2db7f5;border: #2db7f5 solid 1px;color: white;text-align: center;letter-spacing: 4px;cursor: pointer;">编辑</button>
                                <button onclick="remove_question(this)" style="width: 60px;height: 25px;line-height: 23.5px;background: #ff0000;border: #ff0000 solid 1px;color: white;text-align: center;letter-spacing: 4px;margin-left: 10px;cursor: pointer;">删除</button>
                            </div>
                        </div>

                        <div id="text-option-`+question_count+`" style="width: 100%;margin-top: 40px;"></div>

                        <div id="question-option-`+question_count+`" style="width: 100%;margin-top: 15px;display: none;">
                            <textarea name="" id="textarea-text-`+question_count+`" style="width: 100%;height: 70px;border: #cfcfcf solid 1px;outline: none" placeholder="多选题目"></textarea>
                            <div id="options-`+question_count+`" style="width: 100%;">
                                <div style="width: 100%;height: 50px;line-height: 50px;">
                                    <input type="text" class="options-text-`+question_count+`" style="width: 90%;height: 30px;border: #cfcfcf solid 1px;outline: none;" placeholder="【多选】" autocomplete="off">
                                    <span onclick="remove_tag(this)" class="options-span">删除</span>
                                </div>
                            </div>
                        </div>

                        <div id="add-option-`+question_count+`" style="width: 100%;height: 50px;line-height: 50px;display: none;">
                            <img src="../../static/public_file/images/添加.png" alt="" style="width: 20px;height: 20px;vertical-align: middle;display: inline-block;"> <p onclick="add_option(`+question_count+`)" style="color: blue;cursor: pointer;text-align: justify;line-height: 50px;width: 200px;display: inline-block;">增加选项</p>

                            <div style="width: 100%;text-align: center;">
                                <button onclick="CancelEditing(`+question_count+`)" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #f7f7f7;border: #f7f7f7 solid 1px;cursor: pointer;">取消编辑</button>
                                <button onclick="CompleteEditing(`+question_count+`, this)" id="end-editing-`+question_count+`" data-value="多选" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #0d8ddb;color: white;border: #0d8ddb solid 1px;cursor: pointer;">完成编辑</button>
                            </div>
                        </div>
                    </div>
                `
                $("#survey_questionnaire").append(htmls);
            }else {
                htmls = `
                    <div onmousemove="move_tag(`+question_count+`)" onmouseout="out_tag(`+question_count+`)" class="question_list">
                        <div style="width: 100%;">
                            <div style="height: 35px;line-height: 35px;float: left;">
                                <span id="title-`+question_count+`" data-value="c">`+question_count+`、请编辑问题？</span> <span style="color: #2db7f5;">【文本】</span>
                            </div>
                            <div id="question-list-`+question_count+`" style="height: 35px;float: right;display: none;">
                                <button onclick="edit_question(`+question_count+`)" style="width: 60px;height: 25px;line-height: 23.5px;background: #2db7f5;border: #2db7f5 solid 1px;color: white;text-align: center;letter-spacing: 4px;cursor: pointer;">编辑</button>
                                <button onclick="remove_question(this)" style="width: 60px;height: 25px;line-height: 23.5px;background: #ff0000;border: #ff0000 solid 1px;color: white;text-align: center;letter-spacing: 4px;margin-left: 10px;cursor: pointer;">删除</button>
                            </div>
                        </div>

                        <div id="text-option-`+question_count+`" style="width: 100%;margin-top: 40px;">
                            <textarea name="" id="content-`+question_count+`" style="width: 100%;height: 80px;border: #cfcfcf solid 1px;outline: none;"></textarea>
                        </div>

                        <div id="question-option-`+question_count+`" style="width: 100%;margin-top: 15px;display: none;">
                            <textarea name="" id="textarea-text-`+question_count+`" style="width: 100%;height: 70px;border: #cfcfcf solid 1px;outline: none" placeholder="文本题目"></textarea>
                        </div>

                        <div id="add-option-`+question_count+`" style="width: 100%;height: 50px;line-height: 50px;display: none;">
                            <div style="width: 100%;text-align: center;">
                                <button onclick="CancelEditing(`+question_count+`)" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #f7f7f7;border: #f7f7f7 solid 1px;cursor: pointer;">取消编辑</button>
                                <button onclick="CompleteEditing(`+question_count+`, this)" id="end-editing-`+question_count+`" data-value="文本" style="width: 47%;height: 40px;line-height: 40px;text-align: center;background: #0d8ddb;color: white;border: #0d8ddb solid 1px;cursor: pointer;">完成编辑</button>
                            </div>
                        </div>
                    </div>
                `
                $("#survey_questionnaire").append(htmls);
            }
        }

        function move_tag(serial) {
            document.getElementById("question-list-"+serial).style.display = "inline-block";
        }

        function out_tag(serial) {
            document.getElementById("question-list-"+serial).style.display = "none";
        }

        function edit_question(serial) {
            document.getElementById("question-option-"+serial).style.display = "inline-block";
            document.getElementById("add-option-"+serial).style.display = "inline-block";
        }

        function CancelEditing(serial) {
            document.getElementById("question-option-"+serial).style.display = "none";
            document.getElementById("add-option-"+serial).style.display = "none";
        }

        function add_option(serial) {
            var choose_type = document.getElementById("end-editing-"+serial).getAttribute("data-value");
            var html_str = `
                <div style="width: 100%;height: 50px;line-height: 50px;">
                    <input class="options-text-`+serial+`" type="text" style="width: 90%;height: 30px;border: #cfcfcf solid 1px;outline: none;" placeholder="【`+choose_type+`】" autocomplete="off">
                    <span onclick="remove_tag(this)" class="options-span">删除</span>
                </div>
            `
            $("#options-"+serial).append(html_str);
        }
        
        function remove_tag(this_) {
            var trNode = $(this_).parent();
            trNode.remove();
        }

        function CompleteEditing(serial, this_) {
            var data_type = this_.getAttribute("data-value");
            if (data_type !== "文本") {
                document.getElementById("text-option-"+serial).innerHTML = "";
            }
            var options_text_list = document.getElementsByClassName("options-text-"+serial)
            for (var i=0;i<options_text_list.length;i++) {
                var div_str = "";
                if (data_type === "单选") {
                    div_str = `
                        <div class="options-`+serial+`"  style="width: 100%;height: 40px;line-height: 40px;">
                            <input type="radio" name="text-input-`+serial+`"> `+options_text_list[i].value+`
                        </div>
                    `
                }else if (data_type === "多选") {
                    div_str = `
                        <div class="options-`+serial+`" style="width: 100%;height: 40px;line-height: 40px;">
                            <input type="checkbox"> `+options_text_list[i].value+`
                        </div>
                    `
                }
                $("#text-option-"+serial).append(div_str);
            }
            document.getElementById("question-option-"+serial).style.display = "none";
            document.getElementById("add-option-"+serial).style.display = "none";
            document.getElementById("title-"+serial).innerText = serial + "、" + document.getElementById("textarea-text-"+serial).value;
        }

        function remove_question(this_) {
            var trNode = $(this_).parent().parent().parent();
            trNode.remove();
        }

        function scrollConversationScreen() {
            $('#selected-div').scrollTop($('#selected-div')[0].scrollHeight);
        }

        function IdentifyPersonnel(obj_id) {
            close_model();
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            if (obj_id === 'identify-div') {
                for (var i=0; i<selected_personnel_list.length; i++) {
                    var job_number = selected_personnel_list[i].innerText.split('(')[1].replace(")", '');
                    if (!document.getElementById("identify-"+job_number)) {
                        var this_name = selected_personnel_list[i].innerText;
                        var html_str = `
                            <div id="identify-`+job_number+`" style="width: 70px;height: 40px;display: inline-block;vertical-align: top;margin-left: 10px;text-align: center;position: relative;background: #E8E8E8;margin-top: 8px;">
                                <div onclick="remove_identify(`+job_number+`)" style="width: 15px;height: 15px;background: #cfcfcf;border-radius: 50%;line-height: 14px;cursor: pointer;right: -5px;top: -5px;position: absolute;">
                                    <i class="iconfont icon-quchu" style="font-size: 12px;color: white;"></i>
                                </div>
                                <p class="identify-personnel" style="height: 15px;margin-top: 0;font-size: 14px;">`+this_name+`</p>
                            </div>
                        `
                        $('#identify-div').append(html_str)
                    }
                }
            }else {
                document.getElementById(obj_id).value = selected_personnel_list[0].innerText;
            }
        }

        function submit_flow() {
            var form = new FormData();
            var survey_title = document.getElementById("survey_title").value;           // 调研标题
            var apply_user = document.getElementById("apply_user").value;           // 发起人
            var start_time = document.getElementById("start-time").value;           // 开始时间
            var end_time = document.getElementById("end-time").value;           // 结束时间
            var illustrate = document.getElementById("illustrate").value;           // 调研说明
            var identify_personnel_list = document.getElementsByClassName("identify-personnel");        // 可投票人
            var VotingOption = [];
            for (var j=0; j<identify_personnel_list.length; j++) {
                VotingOption.push(identify_personnel_list[j].innerText);
            }

            if (!survey_title) {
                alert("请填写调研标题！");
                return false
            }
            if (!apply_user) {
                alert("请选择发起人！");
                return false
            }
            if (!start_time) {
                alert("请选择开始时间！");
                return false
            }
            if (!end_time) {
                alert("请选择结束时间！");
                return false
            }
            if (!illustrate) {
                alert("请填写调研说明！");
                return false
            }
            if (VotingOption.length === 0) {
                alert("请选择被调研人！");
                return false
            }
            form.append('survey_title', survey_title);
            form.append('apply_user', apply_user);
            form.append('start_time', start_time);
            form.append('end_time', end_time);
            form.append('illustrate', illustrate);
            form.append('VotingOption', JSON.stringify(VotingOption));

            var survey_list = [];
            var question_list = document.getElementsByClassName("question_list");
            for (var i=0; i<question_list.length; i++) {
                var option_title = document.getElementById("title-"+String(i+1)).innerText;
                var option_type = document.getElementById("title-"+String(i+1)).getAttribute("data-value");             // 调研类型
                var OptionList = [];
                if (option_type !== 'c') {
                    var option_list = document.getElementsByClassName("options-"+String(i+1));
                    for (var j=0; j<option_list.length; j++) {
                        OptionList.push(option_list[j].innerText)
                    }
                }
                survey_list.push({"title": option_title, "type": option_type, "OptionList": OptionList})
            }
            form.append('survey_list', JSON.stringify(survey_list));
            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/back-management/QuestionnaireSurvey.html", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate['code'] === 200) {
                            alert('创建成功！')
                            window.location.reload();
                        } else {
                            alert(JsonDate['message'])
                            window.location.reload();
                        }

                    }
                }
             }
        }
    </script>
</body>
</html>